package com.droidwatcher.variables;

import com.alibaba.fastjson.JSON;
import com.droidwatcher.JsonEntity.HttpRequestHead;
import com.droidwatcher.JsonEntity.PhotoJsonOBJ;
import com.droidwatcher.lib.MessageType;
import com.droidwatcher.lib.PhotoEntity;

/**
 * Created by Administrator on 2018/2/23.
 */

public class PhotoServerMsg implements IServerMessage {
    MessageType type;
    PhotoEntity entity ;

    public PhotoServerMsg(MessageType type, PhotoEntity photoEntity){
        this.type = type;
        entity = photoEntity ;
    }

    @Override
    public MessageType getType() {
        return null;
    }

    @Override
    public String getJSONString() {
        PhotoJsonOBJ obj = new PhotoJsonOBJ() ;
        obj.setHead(new HttpRequestHead());
        PhotoJsonOBJ.PhotoEntityInfo info = new PhotoJsonOBJ.PhotoEntityInfo();
        info.setPic_time(entity.getPicTime());
        obj.setInfo(info);
//        LocationEntityInfo info = new LocationEntityInfo() ;
//        info.setLatitude(gps.lat);
//        info.setLongitude(gps.lon);
//        info.setPower(gps.battery);
//        info.setLocation("深圳市南山区科兴科技园中兴大厦");
//        info.setUpdate_time(String.valueOf(gps.date));
//        obj.setInfo(info);


        return JSON.toJSONString(obj);
    }
}
